<?php
/**
 * TW Simply Scroll Module
 *
 * @version 1.0.0
 * @author Tomsy Web
 * @copyright Copyright (C) 2010 Tomsy Web. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * 
 */
 
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
		//
	
if (empty($flickrfeed)) :
?>
<div id="cf">
<div id="gn">
<ul id="scroller<?php echo $k ?>"> <li>
<?php 	
		$db =& JFactory::getDBO();
		$query = "SELECT * FROM #__k2_items ORDER BY id DESC LIMIT 0,10";
		$db->setQuery( $query );
		$rows = $db->loadObjectList();
		foreach ($rows as $item ) :
		if (!is_array($img)) :
			if (!empty($img) && $img != 0) :
	?>
			 <?php  if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_L.jpg'))
								$item->image = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg';
								 ?>
				<img src="<?php echo $item->image; ?>" alt="" width="210px" height="100" />
	<?php 
			endif;
		else :
			//foreach ($img as $url) :
			
	?>
				 <?php  if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_L.jpg'))
								$item->image = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg';
								 ?>
				<a title="<?php echo $item->title; ?>" href="index.php?option=com_k2&view=item&type=sx&id=<?php echo $item->id; ?>:<?php echo $item->alias ;?>&Itemid=4"><img src="<?php echo $item->image; ?>" alt="" width="210px" height="100" /></a>
	<?php
			//endforeach;
		endif;
	endforeach;
?>
</li>
</ul>
</div>
</div>
<?php else : ?>
<div id="scroller<?php echo $k ?>"></div>
<?php 
	endif;
	
 ?>
